package com.dtsz.m2.ui.adapter;

import android.content.Context;

import com.dtsz.m2.R;
import com.dtsz.m2.ui.model.EcologyOrder;
import com.dtsz.m2.volley.commonadapter.BaseCommonAdapter;
import com.dtsz.m2.volley.commonadapter.ViewHolder;

import java.util.List;

public class OrderAdatper extends BaseCommonAdapter {

    public OrderAdatper(Context context, List data, int layoutItemId) {
        super(context, data, layoutItemId);
    }

    @Override
    public void convertView(ViewHolder holder, Object o) {
        EcologyOrder ecologyOrder = (EcologyOrder) o;
        String priceStr = ecologyOrder.getBeoPrice();
        String ecolog = ecologyOrder.getBeoName();
        if("第一生态".equals(ecolog)){
            holder.setTextView(R.id.tv_title, ecologyOrder.getBuName() + "向" + ecologyOrder.getBeoName() + "支付" );
        }else{
            holder.setTextView(R.id.tv_title, ecologyOrder.getBuName() + "向" + ecologyOrder.getBeoName() + "转币");
        }

        holder.setTextView(R.id.tv_price,priceStr + "㎡");
        holder.setTextView(R.id.tv_create, ecologyOrder.getCreateTimeStr());
    }
}
